home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / fdate61a.zip / DO-ONCE.BAT next >
DOS Batch File  |  1992-02-15  |  2KB  |  42 lines

  1. @echo off
  2. cls
  3.  
  4. REM -------------------------------------------------------------------
  5. REM Run daily processing once a day.  Put this code in AUTOEXEC.BAT.
  6. REM This batch file requires DOS 3.3+, since it uses CALL.
  7. REM -------------------------------------------------------------------
  8. if not exist C:\LASTRUN.BAT goto RunNow
  9.  
  10. rem get the date when this was last run
  11. rem ------------------------------------------------------------------
  12. call C:\LASTRUN.BAT
  13.  
  14. rem compare the date when this was last run to today's date
  15. rem ------------------------------------------------------------------
  16. Fdate /Fcomp /At /B%LastRun% /Vcomp
  17.  
  18. rem if today's date is greater than the date when this was last run,
  19. rem then run the once-a-day processing now
  20. rem ------------------------------------------------------------------
  21. IF (%COMP%)==(GT) goto RunNow
  22.                   goto NoRun
  23. :RunNow
  24.  
  25. rem First, record the fact that this processing was run today
  26. rem ----------------------------------------------------------------
  27. Fdate /Ff /Omm-dd-ccyy /At /P"@set LastRun=">C:\LASTRUN.BAT
  28.  
  29. rem Second, run the jobs that should be run only once a day.
  30. rem ----------------------------------------------------------------
  31.  
  32. REM  REPLACE THE FOLLOWING LINES WITH LINES TO RUN THE JOBS THAT YOU
  33. REM  WANT RUN ONCE A DAY...........
  34.  
  35. echo RUNNING ONCE A DAY PROCESSING: Job 1
  36. echo RUNNING ONCE A DAY PROCESSING: Job 2
  37. echo RUNNING ONCE A DAY PROCESSING: ............. etc.
  38.  
  39. :NoRun
  40. set LastRun=
  41. set comp=
  42.